<!DOCTYPE html><html lang="zh-Hans"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><meta name="description" content="huluo的技术博客"><meta name="keywords" content=""><meta name="author" content="kyren"><meta name="copyright" content="kyren"><title>Stay hungry, stay foolish | Kyren's Blog</title><link rel="shortcut icon" href="/melody-favicon.ico"><link rel="stylesheet" href="/css/index.css?version=1.9.0"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css?version=1.9.0"><meta name="format-detection" content="telephone=no"><meta http-equiv="x-dns-prefetch-control" content="on"><link rel="dns-prefetch" href="https://cdn.jsdelivr.net"><link rel="dns-prefetch" href="https://hm.baidu.com"><script>var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?cf87fcdbd9ab7cf93d894f7c219ae78f";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();</script><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><script src="https://v1.hitokoto.cn/?encode=js&amp;charset=utf-8&amp;select=.footer_custom_text" defer></script><script>var GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容:${query}"}},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  hexoVersion: '6.2.0'
} </script><meta name="generator" content="Hexo 6.2.0"></head><body><i class="fa fa-arrow-right" id="toggle-sidebar" aria-hidden="true"></i><div id="sidebar" data-display="false"><div class="author-info"><div class="author-info__avatar text-center"><img src="https://avatars.githubusercontent.com/u/5827823?v=4"></div><div class="author-info__name text-center">kyren</div><div class="author-info__description text-center">huluo的技术博客</div><div class="follow-button"><a target="_blank" rel="noopener" href="https://github.com/huluo666">Follow Me</a></div><hr><div class="author-info-articles"><a class="author-info-articles__archives article-meta" href="/archives"><span class="pull-left">文章</span><span class="pull-right">239</span></a><a class="author-info-articles__tags article-meta" href="/tags"><span class="pull-left">标签</span><span class="pull-right">41</span></a><a class="author-info-articles__categories article-meta" href="/categories"><span class="pull-left">分类</span><span class="pull-right">29</span></a></div><hr><div class="author-info-links"><div class="author-info-links__title text-center">Links</div><a class="author-info-links__name text-center" target="_blank" rel="noopener" href="http://192.168.2.212:9090/">Jira</a><a class="author-info-links__name text-center" target="_blank" rel="noopener" href="http://192.168.2.212:8090/">Confluence</a><a class="author-info-links__name text-center" target="_blank" rel="noopener" href="http://bloc.leniugame.com/">Leniu</a></div></div></div><nav class="no-bg" id="nav"><div id="page-header"><span class="pull-left"> <a id="site-name" href="/">Kyren's Blog</a></span><i class="fa fa-bars toggle-menu pull-right" aria-hidden="true"></i><span class="pull-right menus">   <a class="site-page" href="/">主页</a><a class="site-page" href="/essay">随笔</a><a class="site-page" href="/archives">归档</a><a class="site-page" href="/tags">标签</a><a class="site-page" href="/categories">分类</a><a class="site-page" href="/about">关于</a></span><span class="pull-right"><a class="site-page social-icon search"><i class="fa fa-search"></i><span> 搜索</span></a></span></div><div id="site-info"><div id="site-title">Kyren's Blog</div><div id="site-sub-title">Stay hungry, stay foolish</div><div id="site-social-icons"><a class="social-icon" href="https://github.com/huluo666" target="_blank" rel="noreferrer noopener nofollow"><i class="fa-github fa"></i></a></div></div></nav><div id="content-outer"><div class="layout" id="content-inner"><div class="recent-post-item article-container"><a class="article-title" href="/2018/01/03/js%E5%88%9B%E5%BB%BA%E5%AF%B9%E8%B1%A1%E5%92%8C%E6%96%B9%E6%B3%95/">js创建对象和方法</a><time class="post-meta__date"><i class="fa fa-calendar" aria-hidden="true"></i> 2018-01-03</time><div class="content">一.直接创建
通过键值对的形式将对象中的属性和方法连接起来
1234567var person = &#123;    name : &#x27;张三&#x27;,    age : 18,    sayHi : function () &#123;        alert(&#x27;hello ...</div><a class="more" href="/2018/01/03/js%E5%88%9B%E5%BB%BA%E5%AF%B9%E8%B1%A1%E5%92%8C%E6%96%B9%E6%B3%95/#more" style="margin-top: 14px">阅读更多</a><hr></div><div class="recent-post-item article-container"><a class="article-title" href="/2017/12/29/Mac%E7%BB%88%E7%AB%AF%E6%90%9C%E7%B4%A2%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%B7%A5%E5%85%B7/">Mac终端搜索命令行工具</a><time class="post-meta__date"><i class="fa fa-calendar" aria-hidden="true"></i> 2017-12-29</time><div class="content">mdfind命令就是Spotlight功能的终端界面
12mdfind -name &quot;Photo 1.PNG&quot;  //搜索文件名Photo 1.PNGmdfind -onlyin ~/Library plist //搜索指定文件夹



The Silver Searcherht ...</div><a class="more" href="/2017/12/29/Mac%E7%BB%88%E7%AB%AF%E6%90%9C%E7%B4%A2%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%B7%A5%E5%85%B7/#more" style="margin-top: 14px">阅读更多</a><hr></div><div class="recent-post-item article-container"><a class="article-title" href="/2017/12/29/iOS%E5%86%85%E8%81%94%E5%87%BD%E6%95%B0/">iOS内联函数</a><time class="post-meta__date"><i class="fa fa-calendar" aria-hidden="true"></i> 2017-12-29</time><div class="content">解决函数调用效率

函数之间调用，是内存地址之间的调用，当函数调用完毕之后还会返回原来函数执行的地址。函数调用有时间开销，内联函数就是为了解决这一问题。
​


使用
AFNetWorking
123456789static inline NSString * AFContentTypeForPat ...</div><a class="more" href="/2017/12/29/iOS%E5%86%85%E8%81%94%E5%87%BD%E6%95%B0/#more" style="margin-top: 14px">阅读更多</a><hr></div><div class="recent-post-item article-container"><a class="article-title" href="/2017/12/28/Swift%20%E5%AD%A6%E4%B9%A0%E2%80%94Swift%E4%B8%8EOC%E5%AF%B9%E6%AF%94/">Swift 学习—Swift与OC对比</a><time class="post-meta__date"><i class="fa fa-calendar" aria-hidden="true"></i> 2017-12-28</time><span class="article-meta"><span class="article-meta__separator">|</span><i class="fa fa-inbox article-meta__icon" aria-hidden="true"></i><a class="article-meta__categories" href="/categories/iOS/">iOS</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fa fa-tag article-meta__icon" aria-hidden="true"></i><a class="article-meta__tags" href="/tags/iOS/">iOS</a></span><div class="content">iOS:OC开发中的写法与Swift中写法的对比
Swift 和 OC 对比
函数OC
12345678910111213141516171819202122232425//不带参数- (void)say&#123;    NSLog(@&quot;hello&quot;);&#125;//带有一个 ...</div><a class="more" href="/2017/12/28/Swift%20%E5%AD%A6%E4%B9%A0%E2%80%94Swift%E4%B8%8EOC%E5%AF%B9%E6%AF%94/#more" style="margin-top: 14px">阅读更多</a><hr></div><div class="recent-post-item article-container"><a class="article-title" href="/2017/12/28/hexo%E6%8F%92%E5%85%A5%E5%A4%9A%E5%AA%92%E4%BD%93/">Hexo插入视频,音乐</a><time class="post-meta__date"><i class="fa fa-calendar" aria-hidden="true"></i> 2017-12-28</time><span class="article-meta"><span class="article-meta__separator">|</span><i class="fa fa-inbox article-meta__icon" aria-hidden="true"></i><a class="article-meta__categories" href="/categories/Java/">Java</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fa fa-tag article-meta__icon" aria-hidden="true"></i><a class="article-meta__tags" href="/tags/hexo/">hexo</a></span><div class="content">iOS 视频播放测试
视频1
    

视频2
    

视频3
    

</div><a class="more" href="/2017/12/28/hexo%E6%8F%92%E5%85%A5%E5%A4%9A%E5%AA%92%E4%BD%93/#more" style="margin-top: 14px">阅读更多</a><hr></div><div class="recent-post-item article-container"><a class="article-title" href="/2017/12/28/iOS%20NSURL%E8%A7%A3%E6%9E%90/">URL解析</a><time class="post-meta__date"><i class="fa fa-calendar" aria-hidden="true"></i> 2017-12-28</time><span class="article-meta"><span class="article-meta__separator">|</span><i class="fa fa-inbox article-meta__icon" aria-hidden="true"></i><a class="article-meta__categories" href="/categories/http/">http</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fa fa-tag article-meta__icon" aria-hidden="true"></i><a class="article-meta__tags" href="/tags/http/">http</a></span><div class="content">12345678910111213NSLog(@&quot;absoluteURL--%@&quot;,requestURL.absoluteURL);//绝对NSurlNSLog(@&quot;absoluteString--%@&quot;,requestURL.absoluteString); ...</div><a class="more" href="/2017/12/28/iOS%20NSURL%E8%A7%A3%E6%9E%90/#more" style="margin-top: 14px">阅读更多</a><hr></div><div class="recent-post-item article-container"><a class="article-title" href="/2017/12/27/JSON%E6%95%B0%E6%8D%AE%E5%8E%8B%E7%BC%A9/">JSON数据压缩</a><time class="post-meta__date"><i class="fa fa-calendar" aria-hidden="true"></i> 2017-12-27</time><span class="article-meta"><span class="article-meta__separator">|</span><i class="fa fa-inbox article-meta__icon" aria-hidden="true"></i><a class="article-meta__categories" href="/categories/iOS/">iOS</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fa fa-tag article-meta__icon" aria-hidden="true"></i><a class="article-meta__tags" href="/tags/iOS/">iOS</a></span><div class="content">1&lt;script src=&quot;https://cdn.bootcss.com/lz-string/1.4.4/base64-string.js&quot;&gt;&lt;/script&gt;

1234567891011// sample json objectvar jsonobj ...</div><a class="more" href="/2017/12/27/JSON%E6%95%B0%E6%8D%AE%E5%8E%8B%E7%BC%A9/#more" style="margin-top: 14px">阅读更多</a><hr></div><div class="recent-post-item article-container"><a class="article-title" href="/2017/12/27/iOS%E4%BB%A3%E7%A0%81%E6%89%A7%E8%A1%8C%E6%97%B6%E9%97%B4/">iOS代码执行时间</a><time class="post-meta__date"><i class="fa fa-calendar" aria-hidden="true"></i> 2017-12-27</time><div class="content">在测试代码效率是往往会用到
StackOverflow How to log a method’s execution time exactly in milliseconds?
12345//单位换算1分(min)=60秒(s)1秒(s)=1000毫秒(ms)1毫秒(ms)=1000微秒(μs)1 ...</div><a class="more" href="/2017/12/27/iOS%E4%BB%A3%E7%A0%81%E6%89%A7%E8%A1%8C%E6%97%B6%E9%97%B4/#more" style="margin-top: 14px">阅读更多</a><hr></div><div class="recent-post-item article-container"><a class="article-title" href="/2017/12/25/iOS%E5%8F%82%E8%80%83%E5%8A%A8%E7%94%BB/">iOS参考动画</a><time class="post-meta__date"><i class="fa fa-calendar" aria-hidden="true"></i> 2017-12-25</time><div class="content">iOS动画总结

https://github.com/yixiangboy/IOSAnimationDemo
https://github.com/aizexin/AIAnimationDemo

🍎 界面转场动画集

https://github.com/alanwangmodify/WXST ...</div><a class="more" href="/2017/12/25/iOS%E5%8F%82%E8%80%83%E5%8A%A8%E7%94%BB/#more" style="margin-top: 14px">阅读更多</a><hr></div><div class="recent-post-item article-container"><a class="article-title" href="/2017/12/22/WKWebView%E7%9A%84%E4%BD%BF%E7%94%A8/">iOS WKWebView的使用</a><time class="post-meta__date"><i class="fa fa-calendar" aria-hidden="true"></i> 2017-12-22</time><div class="content">1、WKWebView与js交互
主要有两方面：1、js执行OC代码  2、oc调取写好的js代码

js调用OC：js是不能执行oc代码的，但是可以变相的执行，js可以将要执行的操作封装到网络请求里面，然后oc拦截这个请求，获取url里面的字符串解析即可，这里用到的代理协议。
主要原理：通过 UI ...</div><a class="more" href="/2017/12/22/WKWebView%E7%9A%84%E4%BD%BF%E7%94%A8/#more" style="margin-top: 14px">阅读更多</a><hr></div><nav id="pagination"><div class="pagination"><a class="extend prev" rel="prev" href="/page/5/"><i class="fa fa-chevron-left"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/5/">5</a><span class="page-number current">6</span><a class="page-number" href="/page/7/">7</a><span class="space">&hellip;</span><a class="page-number" href="/page/24/">24</a><a class="extend next" rel="next" href="/page/7/"><i class="fa fa-chevron-right"></i></a></div></nav></div></div><footer><div class="layout" id="footer"><div class="copyright">&copy;2022 By kyren</div><div class="framework-info"><span>驱动 - </span><a target="_blank" rel="noopener" href="http://hexo.io"><span>Hexo</span></a><span class="footer-separator">|</span><span>主题 - </span><a target="_blank" rel="noopener" href="https://github.com/Molunerfinn/hexo-theme-melody"><span>Melody</span></a></div><div class="footer_custom_text">hitokoto</div><div class="busuanzi"><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><span id="busuanzi_container_site_uv"><i class="fa fa-user"></i><span id="busuanzi_value_site_uv"></span><span></span></span><span class="footer-separator">|</span><span id="busuanzi_container_site_pv"><i class="fa fa-eye"></i><span id="busuanzi_value_site_pv"></span><span></span></span></div></div></footer><i class="fa fa-arrow-up" id="go-up" aria-hidden="true"></i><script src="https://cdn.jsdelivr.net/npm/animejs@latest/lib/anime.min.js"></script><script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js"></script><script src="https://cdn.jsdelivr.net/npm/velocity-animate@latest/velocity.min.js"></script><script src="https://cdn.jsdelivr.net/npm/velocity-ui-pack@latest/velocity.ui.min.js"></script><script src="/js/utils.js?version=1.9.0"></script><script src="/js/fancybox.js?version=1.9.0"></script><script src="/js/sidebar.js?version=1.9.0"></script><script src="/js/copy.js?version=1.9.0"></script><script src="/js/fireworks.js?version=1.9.0"></script><script src="/js/transition.js?version=1.9.0"></script><script src="/js/scroll.js?version=1.9.0"></script><script src="/js/head.js?version=1.9.0"></script><script src="/js/search/local-search.js"></script><script>if(/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)) {
  $('#nav').addClass('is-mobile')
  $('footer').addClass('is-mobile')
  $('#top-container').addClass('is-mobile')
}</script><div class="search-dialog" id="local-search"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章"></div></div></div><hr><div id="local-search-results"><div id="local-hits"></div><div id="local-stats"><div class="local-search-stats__hr" id="hr"><span>由</span> <a target="_blank" rel="noopener" href="https://github.com/wzpan/hexo-generator-search" style="color:#49B1F5;">hexo-generator-search</a>
 <span>提供支持</span></div></div></div><span class="search-close-button"><i class="fa fa-times"></i></span></div><div class="search-mask"></div></body></html>